moved angular controller code to controllers.js