Added smart positioning.

Fixes #14