rework of gpu code