added non-finished controller logic