Added equality function to help with testing
Removed redundant code