Should probably mention that the number has be to greater than 512 since you check for that.