write halve and corresponding helper in ILL