working, but needs some cleanups+compatibility wo