Init code from assignment
Submitted solution