Made log more flexible