Removing print statements.
Factor out determination of max element dimension into separate function.

Delete the lower-dimensional elements after reading the file.