         ]
     }
 
+    public func stepBeforeStep(step: ORKStep?, withResult result: ORKTaskResult) -> ORKStep? {
+        if let step = step {
+            // return appropiate step
+            let index = steps.indexOf(step)
+            if let index = index where index - 1 >= 0 {
+                return steps[index - 1]
+            } else {
+                return nil
+            }
+        } else {
+            return nil
+        }
+    }
+
+    public func stepAfterStep(step: ORKStep?, withResult result: ORKTaskResult) -> ORKStep? {
+
+        if let step = step {
+            // return appropiate step
+            let index = steps.indexOf(step)
+            if let index = index where index + 1 < steps.count {
+                return steps[index + 1]
+            } else {
+                return nil
+            }
+        } else {
+            // return first step
+            return steps.first!
+        }
+
+    }
+    
+    public func progressOfCurrentStep(step: ORKStep, withResult result: ORKTaskResult) -> ORKTaskProgress {
+        let index = steps.indexOf(step)
+
+        if let index = index {
+            return ORKTaskProgressMake(UInt(index), UInt(steps.count))
+        }
+        
+        return ORKTaskProgressMake(0, UInt(steps.count))
+    }
+
 }

        let slowFastQuestion = Question(identifier: .SlowOrFast)
        let suicideQuestion = Question(identifier: .FeelingSuicidal)
        
        return [
            pleasureInterestQuestion.step,
            depressedQuestion.step,
            sleepQuestion.step,

/// Task that contains the questions of the [PHQ-9](https://en.wikipedia.org/wiki/Patient_Health_Questionnaire#Versions) questionnaire.
public class SelfTestTask: NSObject, ORKTask {

    private let steps: [ORKStep]
    
    public let identifier = "SelfTest"    

    public override init() {
        let pleasureInterestQuestion = Question(identifier: .LosingInterest)
        let depressedQuestion = Question(identifier: .FeelingDepressed)
        let sleepQuestion = Question(identifier: .TroubleSleeping)
