library day/night functionality