continuing with commenting/documenting code, plus small code improvements and cleanup