Modified and fixed #6, bomale suggestion