+fillTime :: Hull -> (S.Set Position) -> [(Position, Integer)] -> Integer -> Integer
+fillTime _ _ [] t = t
+fillTime hull closed ((here, t):boundary) maxt
+ | hull!here == Wall = fillTime hull closed boundary maxt
+ | S.member here closed = fillTime hull closed boundary maxt
+ | otherwise = fillTime hull closed' (boundary ++ neighbours) (max maxt t)
+ where closed' = S.insert here closed
+ neighbours = map (\d -> (step here d, t + 1)) directions
+ directions = [North, East, South, West] :: [Direction]
+