how to write a program