Modified XML comments to make them accurate to the current workings of the program. Simplified some functions where code was used multiple times