Changed classes structure. Fixed SP class.