some cleanup, fixed pointer variables, and added a program header