somewhat working
seems to work ok for now