Random code snippets from aborted scripts that might be useful in the future...