need to replace all the position lookups with pos dict