Fix "splitted" else lines resulting from previous reformatting

Partially addresses #8
Remove global declaration of variables at the start of the functions

Partially addresses #8