basic jS logic