tidying up code, functions in wrong place, still issue with 30 min increments