formatted code as requested by Jérémie Laval