fixes compilation errors. much nicer now