Refactored to remove hand indices from code
refactored, still needs work