updated with better documentation