updated readme and made code a little clearer