solution for List.hs