added Controller

added code of #1