change locoPortion type to double
refactor index page - wire with back-end