significant refactoring and added solar night length and solar midnight