Made it all conditional on direction being vertical