implemented aspect-ratio calculations and background relation code