initial implementation of add code