implemented comparison clauses and fixed bug causing excessive instances