added vertical angle detection