Completed program framework -- produces incorrect results