added models, fixed code