Added compare functions and more tests