added main.cpp and overload functions on iterator