comments + logging added