forgot to link stdmath
cleaned up formating

removed some debug lines(im not good enough to make a makefile flag for that yet)
added pretty print convincence function
added comments and formatting