eliminated inner loops
modified makefile