Update code

I updated the code. It still needs to be documentated