adding functional logging