New improvements

Here I debug some functions like check vertical and horizontal and edit
some minor code