compiles with g++
cleaned things up a bit