Still has problems reading values. Compiles fine. Does not yet have gain caculations