better formatting for the delay function