moved dimension definitions after mass table read in
removed old definitions
tidying up code, added a comment