commenting code for better understanding