transfered old code