porting pusharray env
removed useless code