changed style, fixed a few bugs