Finished with comments, format should be ok.

More testing might be needed.