fixed a number of bugs, updated get2d(), minor trimming