udpated code to allow for sleep before rendering data back to user.