better handling of large amounts of pins (wasn't commited with previous)