rearrange code and completing readme