unfinished; some functions broken