chagned to 16 bit resolution