Updated and cleaned the code