modified the script to check for overlapping intervals instead of login time