Added horizontal rotation logic