Compelete Code. It's Ugly