added option to perform log transformation