cleaned up the old code