use existing functions, synchronise with paper reference