documented the code better