finished adding basic comments for everything. slight refactoring