Added more detailed inline comments