Updated to make it actually work and work somewhat quickly