added web connectivity; split main file