Added a debug toggle
Added a S+ parameter to set the buffer size