Added logging function, changed method of handling binary to strings from long, work in progress