Started adding support for delays (not yet read from file though) and for output (loop needs to be written)