Added sql snippets, improved login scripts