Created algorithm to find initial Y position for buttons