Finished implementation. Fix bugx.