Got working tps code