Logging

Added logging everywhere neccessary