completed functionality for assignment