This will give the idea about how to code