finished tidying up some things, everything should work