HUGE update

enormous structural update
add several classes
function arrangement