sam's c code in study and work