clone of http://gitorious.org/nitrohack/ais523