Changed bit to use standard library function