Refer to #CODE BLOCKS 5,6,7 # on Jupyter Notebook