Updated to do optionals better, and to have ajax choices