Implements main class