Excercise 17 w/ global connection variable