Can you write some pseudo code for this? Showing the correlation between the steps you gave and the code itself.