Add proper logging. Closes #1