cleanup, still not 100% sure on functionality