Is it a 5 speed? One time my friend and I were doing a clutch job on a prelude and when we finished and drove it the car loses power & kind of jumps like you said right at 4000rpm, well we checked all the connections & cleaned all the grounds to make sure they had good contact and it ran fine. Plus check your plugs and wires, make sure there is no water anywhere.