Updated with better comments