Fixed problems so it actually works