session stuff mostly works