start to rewrite recurtion