Integration of code
Fixed it up to work!