made better, no big amount of memory needed