optimized createGraph method by using bitshifts! :)