Added logging functionality!