implemented matrix and pos builder