c code for simple tasks