Added logic and some setup.
Added logic and some setup.