Added detailed comments