more coding. compiles, untested