built out controller logic