All functions (except redraw) partially finished