class updated and improvement