changed the ret array to [0,1,2...]