non-working solution to problem18