Implemented last two requirements from #21, along with related changes