Solution to level 44 in Untrusted: http://alex.nisnevich.com/untrusted/