completed assignment-6

all except bonus, but it's completed and I double-checked the returns
each time to insure a proper return (not just satisfying the test
conditions)