Inserting values and general improvements