cleaned up sample controller