fixing double from horizontal and vertical logic