Improve error handling
use self instead of assuming global so this works on FF and IE
Round the numbers
Don't use capture