New model code. Slight updates