Updated for new input foramt