Added lots of code. Not working. It's a mess