began scripting stuff. not perfect