add calculateScale