added the yeild function