     }
     
     // convert double hours to 12h format
-    func floatToTime12(var time: Double,noSuffix: Bool) ->String {
-        
-        if (time.isNaN){
-            return InvalidTime
-        }
-        
-        time = fixhour(time + 0.5 / 60) // add 0.5 minutes to round
-        var hours: Int = Int(floor(time))
-        let minutes = Int(floor((Double(time) - Double(hours)) * 60))
+    func floatToTime12(time: Double,noSuffix: Bool) ->String {
+        
+        var adujestedTime = time
+        
+        if (adujestedTime.isNaN){
+            return PrayerName.InvalidTime.rawValue
+        }
+        
+        adujestedTime = Double.fixHour(adujestedTime + 0.5 / 60) // add 0.5 minutes to round
+        
+        var hours: Int = Int(floor(adujestedTime))
+        let minutes = Int(floor( (Double(adujestedTime) - Double(hours)) * 60))
         var suffix: String, result: String
         if (hours >= 12) {
             suffix = "pm"

    // ---------------------- Misc Functions -----------------------
    // compute the difference between two times
    func timeDiff(time1: Double, time2: Double) -> Double {
        return fixhour(time2 - time1)
    }
    
    // -------------------- Interface Functions --------------------
    // return prayer times for a given date
    func getDatePrayerTimes(year: Int, month: Int, day: Int, latitude: Double, longitude: Double, tZone: Double) -> Set<String>{
        lat = latitude
        lng = longitude
        timeZone = tZone

    public init(caculationmethod: CalculationMethods, asrJuristic: AsrJuristicMethods, adjustHighLats:AdjustingMethods , timeFormat:TimeForamts, offsets:[Double]){
        self.offsets = offsets
    }
    
    
    
    
    
    
    // ---------------------- Julian Date Functions -----------------------
    // calculate julian date from a calendar date
    func julianDate(year: Int, month: Int, day: Int) -> Double{
        
        var adujestedYear = year
        var adujestedMonth = month
        
        if (adujestedMonth <= 2) {
            adujestedYear = adujestedYear - 1
            adujestedMonth = adujestedMonth + 12
        }
        
        let a = floor(Double(adujestedYear) / 100.0)
        let b = 2 - a + floor(a / 4.0)
        let jd1 = floor(365.25 * Double(adujestedYear + 4716))
        let jd2 = floor(30.6001 * Double(adujestedMonth + 1))
        let jd = jd1 + jd2 + Double(day) + b - 1524.5
        
        return jd
