refactored for new cocos2d style