made Laurn's script less dumb. This closes #1