working on converting copied script to function for new purpose