recurssion solution added