major update of all code