inputStructure almost done, needs correctness check