tidied code and added activerecord transaction to create, update, destroy actions for wagers, distributions and deposits