Remove debugger from start of file.
Start editing segment detection code to keep a few easy variables attached to each segment when inserting it into database.