Cleaned up output, shows the type of elements
Fixed a few bugs