Added my code with counting height for one direction but its not possible to check left,right and so on