Added first and last menu class function.