Working but table displays in wrong order.