chan's algorithm implementation in java