many functions added, not cleanes up