(*) Added more comments and docs