This is unoptimized past the point in the previous file by Tompa and ThunderAxe31, but it's meant to show the concept working.