major refactor, but need to figure out form increasing length issue