Added for loops, improved several small things