added draw functions and discard functions, mostly working