implementing a controller