changed the environment calculation

left-right and top-bottom give different results...