Thanks, i've already figured out the code.

btw, how do i deal with numbers that are bigger than 65535?

Just curious though...