plot kxx finished
Fixed bugs and added error plot functionality