Implemented main() function