4th revision of my codeeval.com solutions