some modifications here and there