Implemented the use of horizontal and vertical methods
implemented horizontal/vertical