reformatted code to implement player movement upon fling