bug fixes and added quality option