Added code used in competition. More effective code and ASkills requires testing.