add sessions_filename argument and -debug flag