Use ints intsead of longs, select direction of threshold (gt or lt)