Updated script to allow for height/width ratio