make a simple wrapper script, move everything else into a library