Old and new implementation added
Code added for debug state