pretty much finished the kepler code