adding codes for Kannan project, first attempt