implemented the logic of walk, walking, walked