Added preferences menu, cleanup