updated functions to be more in line with original function samples.