changed all the code