Uploaded answer to Q12a and fixed some typos