Implemented proper semantic check #71

after consultation with Dr. Soo