Added more functions.
Added more states.