Overhauled mostly working some small bugs