1. Cange variables 'dir' and 'str' to 'direction' and 'msg'.
2. Remove import os.
3. Change raw_input result handling.