Added code to determine sections