added constants, fixed goal detect bug