Added 'pos' position variable