cleaned up formatting (bigger tabs), moved regex expressions its own function for scalability