simple c code, write whenever you can