main prototype code.