Finished optimization and added several tests
Finished optimization and added several tests