added in functionality for edit and new study also made some other changes so make sure you pull before you edit