kinda works. have some hacks need to be changed.