updated model, checked for bugs