Added a scalable version, kinda bugged and inefficient right now.