I couldn't understand what you are writing in the code, I hope you will explain the important parts with comments next time.