bug fix; added partial solution to codility challenge