added output var.
updated with removed c param
Writer changed to RWS.
removed States and such.