Added horizontal controller logic