Useless functions removed; more debugging added;