Solve exercises for first chapter