Let me try to explain you what the first method does:
Try to understand this method clearly. The best way is to use pen and paper and try to do it yourself.
Try doing the same with the second method and see if you are able to understand.
Add new lines CR[/edit]