work on main program
made kd 60 times smaller
in the middle of calibrating
freq commented
removed nonworking code in main program