updated with newer model structures
brought in latest updates from oc master