added changes to code