Reformatted code for new setup