updated and removed unused codes