traverse' (p1:p2:ps) (c:cs) = (c + max p1 p2) : traverse' (p2:ps) cs
traverse' (p1:p2:ps) (c:cs) = (c + max p1 p2) : traverse' (p2:ps) cs
traverse' (p1:p2:ps) (c:cs) = (c + max p1 p2) : traverse' (p2:ps) cs