magic = setmetatable( {}, { __index = function( table, func )
  for idx, side in ipairs({ "left", "right", "top", "bottom", "back", "front" }) do
    if peripheral.isPresent( side ) then
      for idx2, method in ipairs( peripheral.getMethods( side ) ) do
        if method == func then
          return function( ... )
            peripheral.call( side, method, ... )
          end
        end
      end
    end
  end
  return function( ... )
    error("Error.")
  end
end } )

magic.write("Hello from Cobi's wrapper")
