now with less memory consumption!