Simplify oss and modify it to receive array input