         else
           $scope.title = "#{data.results[0].bill_type.toUpperCase()} #{data.results[0].number}"
       ).error (data, status) ->
-        console.log "Error #{status}: #{data} (thrown by getBillTitleOnLoad)"
+        console.log "Error #{status}: #{data} (thrown by getBillTitle)"
 
     getQueryListOfBills = ->
       query = $scope.bill_query.replace(/\s/g, '%20')



    getBillList()
    getBillTitleOnLoad()
    getBillTextOnLoad()

  ])


    makeBillId = ->
      billCode = $location.path().split("").splice(13,15)
      bill = billCode.splice(3,12).join("").replace(/ih/, '').replace(/is/, '').replace(/ats/, '').replace(/enr/, '').replace(/rfs/, '')
      congress = billCode.splice(0,3).join("")
      return "#{bill}-#{congress}"

    getBillTextOnLoad = ->
      if $location.path() != "/bills" then getBillText(makeBillUrl($location.path().split("").slice(7).join("")))
      getBillTitle()

    getBillTitle = ->
      bill_id = makeBillId()
      $http(
        method: "GET"
