Fixed the Code So it actually works