added vertical scroll logic