fixed the memset issue and few naming conventions