Added code from console application.
Coded session import.