Final version for assignment.