kinda works, few bugs