Fixing bugs and adding changing of model