Impoved and fixed a bunch of issues