added keyed scaling