cleaned up functions file