Added code for model building