Changed several thigs to enhance speed