I am posting the code that is originially instructed by Professor Khaja at DVC.