Added code to restrict player movement