Sort of more working... needs a lot of cleanup and bug fixes