cleaned up c4 model code, note still not tested, ergo not working