added begin of sight code