added optimizations, modified readme