changed mypos from local to global