wrote main pose recognition code