working
still have bug somwhere