added compare function as option and some more functions