added some initial to_binary function