some changes in comparing functions