minor fixes and added log
updated for better measurements