Second revision of implementation of pen tool.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>