Finished inlining the addResource function