Updated once function with more understanding