made numFromSeq more general, got solution for problem 6