eraseLoop (x:xs) = case dropWhile (/=x) xs of
                       [] -> x: eraseLoop xs
                       (h:rest) -> h : eraseLoop rest
eraseLoop (x:xs) = case dropWhile (/=x) xs of
                       [] -> x: eraseLoop xs
                       (h:rest) -> h : eraseLoop rest
eraseLoop (x:xs) = case dropWhile (/=x) xs of
                       [] -> x: eraseLoop xs
                       (h:rest) -> h : eraseLoop rest