implemented most calls of program.c