final version, works on chrome and firefox