Finished implementation and debugging.