Documented the code better and added util code
A-aron told me to