formatted code. no changes in functionality