sleep() was not found on my ubuntu 12.10.. added header unistd.h