Added more documentation and refined some details