Added some commenting to clear up what some of the resource based code is doing.