Refactored triangle drawing so it can be dynamic