merging in changes from Calgames 2013