Code Optimizations

Eliminated redundant code, cleaned up the API, and fixed some typos in
the readme file