First two exercise,optimize later