added a bunch of code
merged and added code