Incorporated some remarks from the previous review. Probably still needs some touches. Comments welcome.
View Diff