implemented main view controller