Fixed a bug and altered the dely logic a little bit