improvements in model and fixes