add logging and fill documentation