Lots of code updates from testing