changed ajax to add position, test keys