Code formatting, better schedule function.