working on ratio's solution