added parameter heightCorrection and rectangelPadding