fixed bug
works mostly