First off, don't feel bad about it not executing properly, that was the universities fault - a logic error on their part.
The assessment worked wrong like that.

Mr.777 provided what the code...