Making scripts more robust and adding setup and startup scripts