Added comprehensive comments