left note to try solving without recursion