Input

made some modifications so that we can now pass the prev input state as
well