Removed windows API and added UNIX sleep