first part of code implemented, next step: insert Mary's code