lots of debugging, fixing bugs, I hope