Added detailed commenting.