Added new functions to main
Moved iterator to core module