avg option in compare method is now working properly