added timer/fixed index error, still needs to be refactored