fixed code

code is all fixed and working correctly