fixed calculation of the resolution