added pen tool functionality