What codes "came up on the scanner?"
When was the throttle body last cleaned, and is it clean now?
Test the IAC function. Any vacuum leaks?
When you say you changed the crankshaft I'm going to assume that you mean the crankshaft position sensor. After changing it, a CASE relearn should be...