Full featured script without comments and untested