generating a controller