Added code from EZplatformer