Lots of code updates