orignal code