initial checkin of working script that has room for improvement