Start of logic for render distance