huge commit with a lot of commented code, for safety