apl reference implementation