finally fixed loading system!
manual merge and additional minor code styling