this kinda works. need to finalize