update README; polish code a bit