Finished implementation. But is it correct??