Bad code... Needs significant refactoring. Memory leak city.