Finl version for HW6