Made non recursive