Motyar credit by original code