Implemented main.