added some helper functions
Element present checks added