refactor
implemenetd applyLeft
formatting

use more consistent formatting when declaring vars
newline between function and var
formatting

unused ';'