adding a stable version of the code