updated readme & example

removed some redundant code & added logging