Putting data in correct format