cleaned up weird function that didn't work