Move repeated code for calculating random bot throw into function
Fix indentation