Added a bit of commentary to the code