Basically added the whole program. It doesn't work as intended though.