main script editted to read custom objects