incorrect handling of error fixed
makefile added
little changes