moved horizontal code up, vert down