made some more changes to the code