Lots of code added

More descriptive comments coming soon!