         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')

        method: "GET"
        url: "http://congress.api.sunlightfoundation.com/bills?apikey=3cdfa27b289e4d4090fd1b176c45e6cf&per_page=100&page=1"
      ).success((data, status) ->
        console.log "Initial 'getBillList' data below:"
        console.log data
        $scope.bills = data.results
      ).error (data, status) ->
        console.log "Error #{status}: #{data}"


    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"
