Added comments for clarity.