scope rules diagram added to documentation