Added test fot reversing and made some cleanup