code formatting - if should have {} and necessary newlines