cleaned up warnings and added -Wall flag to compile