EDIT: finally a working model!