working on function to saving cursor position in vertical and horizzontal selections