homework completed

Good!  Gets the right result.  but you can drop the intermediate assignment. also no need for c().