updated with support for applying converion factors to variables