Following Meng To's book tutorial.