implemented .before() and .after() method (fixes #21)