delete rec in second solution