Efficiency improvements, comments, docs update