Formatting javascript