Reformatted code for easy reading.