Added a README, fixed some bugs