rebasing for assignment 7, new functions