Initial v4.0 code