Added comments for better understanding