Moved height into method.
Moved line drawing logic into its own method.
Moved screen clearing logic into a separate method.