started building optimization function for the structure based on the observed encounter probabilities