added majority of the code to the lib
created bin file. split up old singe file in to class and procedures