Addressed issues with bad arguments
use nanosleep instead of usleep
Minor changes for clarity and speed