Adding log function