Chapter1: allocated common functions in solution 1-22 (for convenience only, used some unconsidered)

Done for convenience only, some unconsidered themes in Chapter1 were used for simplification