added in vars image_a image_b and their complex counterparts
change the way error handling works in static functions