Lots of changes and improvements