Refactored a bit and updated Makefile and gitignore