allocate memory first in init()
include unistd.h for sleep