worked out goal detection