added session and and re arranged some things