turned off a lot of debugging code, things seem to be working now
fixed formatting, removed last bit of debugging code
added simple ulimits to catch processes that would otherwise run forever