Corrected some errors
PCA to find contour
Fixed some issues