Adding script written by Sebastiaan Joosten.