create a method to solve this problme