Made the implementation of the method turn and fixed the method
isValidDirection