added RS latch