implemented some important methods.