coding for final assignment