added extra information to determine the correct scaling