adding stable version of the code