half-baked binary to decimal solution, will finish up tomorrow