Add commenting

Add comments for cachesolution function