trying to figure out coordinate loop error