completed solution for 'series'.