initial script based adapted from fall 2013 documentation