fixed everything that was broken
still need to make it work for public, make it repeatable and do a bit
of tidy up