added code to remove and replace atoms in molecule once completed. buggy!