Update tilt.py

Added a source
Corrected 2 bugs involving output
Added a funcion