Added some functionality from CyanKang

Signed-off-by: Dominik Bittner <DoBi-tyndur@gmx.net>