Debugging and bug fixing. Still some bugs.