commented code, some name changes