added splitting horizontally and vertically