condense code, add click and drag to draw