made repeat loops work. added basic error detection. some refactoring on the way