Different approach to solving