updated implementation and skeleton with new log function