altered some controler and model code