Finished code, but still has bugs.