Execute on timeout
Tidyup C and add sleep