updated readme, reorganized code a bit