basic functions are mostly working now