hint function added and some bugs fixed