Added robust select and insert into the interface
debugging and streamlining here and there