Changed variable names, more bugs removed;