Added a lot of comments, fixed some minor bugs, the fatal method implied.