reformatted code to match original indentation, etc