cleaned up old code at end