Updated with better documentation