Fix placePrices function, cleaned code

Added missing }, removed some extra whitespace and a few var declarations.