3rd revision of my codeeval.com solutions