Code pretty much done, bugfixes needed