solve remaining parts of assignment 6