reformatted code as suggested