For code, please refer to my Github page.