slightly modified version of laura's script