add a makefile for building
get rid of the exit calls
add header file for the random functions