Added more comments for readability