Solution for binary to decimal, decimal to binary and counting set bits in an int