Added more documentation and scope