put calculation inside C program instead