It actually works now!

Has some bugs. Will update later.