implemented first pass of backend datastructures