wrote functions

wrote the code for assignment 2
Revert "More typos"

This reverts commit 7f657dd22ac20d22698c53b23f0057e1a12c09b7.
Revert "wrote functions"

This reverts commit d81d2c08608668d5ac923d25b22b6e51b33b8ed5.
Revert "Revert "wrote functions""

This reverts commit 719f091ed306673b97f88c530193d5e18f3d7005.