cleaned up code
cleaned up more code
fixed index