refactored... hopefully uses less ram now