help with creating functions for element