fixed some variable decl. and added support for all channels. Also changed read pins