Version 3.0 after Rhiju's comments