structure of the model and bug fixing