added comments and doc strings