Re-organized code

Wow. Much modular. Very comment. So class.