Added logging and docs