please add what the parseProgram algorithm does