Fixing problems with unstable Session data (not finished) and reordered Code.