rewrote with Bastian