Working controller
solved merge conflict