merge pr9 off-by-one
merge pr20 add newlines
merge pr16 replace int_pow with bitshift