Code and tested both assignment functions