Added inline docs and a tiny fix