added style classes based on Q's type