Added input and output arrays with saving mechanism, only uses 1 int!