trying to get script to work right