Working
Combined events into one js method