Final version

Fixed some bugs and updated style