working controller (not synced with host code)