@jaki01: Complete solution