small improvements. time to refactor some loops... it's getting laggy.