Added testing and "run from file" option