adpat some exercise to be coherent

as we introduce functions earlier in course
the exercises change a lit bit
adapt some exercise to use function develop in previous exrecises