Working version before starting work on ABC code.