Added a lot, lots of comments as well to explain step by step whats going on.