Refactoring

Refactored how the js functions read the medals and assign places