debugging code

checking and fixing code