Commented and re organized.

Planning for future functions and editions are at the bottom of the code