new code and remove useless test code