Edited after forke by ilaiya

Please check,