final version with old model