replaced startswith with splice