Added comment blocks to each function