added more comments to resource.rb