formatting
formatting
db refactoring
connecting logout handler
event handlers added; connection on init() added