updating
works again
new, better code