Have developed a code that can be runned successfully.