Huge changes in the code