Just doing scales in javascript