So much conditional branching. Testing out JS syntax