added a new rakefile and fixed some bugs