Handmade solution 2

This is my first pull request.  Let me know if everything is ok.