Code cleanup; added usleep function *not compiled yet*