fixed bug with overflow
fix makefile