final changes to the code