change from subtraction to Long comparison