null check in equals and compare
added equals and compare functions
change mathod names and added new methods