Updated main, now fully works.