stream-map; pattern is from sicp, just added the missing parts