updated code but still not working when called more than once
adding makefile