removed redundant functions and fixed height automation