added accept method and one more constrctor