formatted code a bit