rewrite lithium.sh