Add working regression code