turned up warnings and cleaned it up, plus unit tests added and working