Finished initial implementation of script with prims only, untested