some modifications and testing