New Update function
Code formatting