formatted code a little