partially fixed program; added temporary comments for debugging