Added makefile
Fixed warning about unhandled enumeration values in switch
Variables were redefined instead of used