added corePlot library
fixed critical bugs in the algorithm