My solution to SK planet Code Sprint 2014 Round 1