eliminated a little duplication
added support for additional basic elements