fixed a lot of bugs, yet several other still present.