trying to write better js