tried to reduce mem usage