Added single section test, and made code more compact