finishing touches for code cleanup, commenting and reducing to zero warnings