Changed Datapath with two generics (input and output)