fixing bugs and changing style