added script from Paul that works