fixed NaN issue
minor style changes
major core changes in functionality