Added tests and comments. Fixed some :poop: