final version for assignment