Added an example and optimised the initialisation