Adding logging and changing function name