Major update

and some clearcoding