Updated with more in-line documentation