merge compareRefMaps functions, create calc_logpro and update_prob function to remvoe code duplication