cleaned up some code and am now using my peaque library as a submodule
moved some stuff to util
and here's the util file