Updated with a more sophisticated doc