erm lots of random fugly code everywhere