Final homework with write-up