many changes to code