Debugging

few bugs debugged and few more left