new js function: small for tables