tested and fixed errors, added octet_to_int