move fn() into model and give find_MAP a better error message
move RV stuff into model