Create Code V2.py

Complete re-work with functions. (not done)