Tweaked code and added a makefile for building on Linux