added manipulator and fixed main.cpp