Updated and tested