fixed a lot of stupid mistakes