pushing optimization with some additional changes. edited rakefile.