added explanations

Added explanations outside of code area to make it clearer.