Algorithm For Dimensionality Reduction