needed to do this commit sooner
Some fixes in code so recopied them over