Started refactoring function to identify vertical seam