add method comments
refactor equality check