finishing the code