removed unused function
added debug statement