Added drag'n'drop feature, fixed pen tool (calculate x, y properly) and clean up some code