code improvements and readme changes