fixes and cleanup of Caliers algorithm implementation