Assignments 1 & 2 (merged with Nian's parts)