ok martynas@
ok martynas@, feedback from steven@
based on work by Alexander Wirt <alexander.wirt@credativ.de> ok simon@