Fixed bad calculation