Code organization

rewrote variables to be more meaningful. Improved documentation