updated to run outside of arcmap, fully functioning test version