Improved order in quarters results
Improve order in quarters results.
Completed the Python implementation for quarters.