Some more functions, not all well tested