Modified stuff when glass|emma suggested.