Set up interval code