new functinos, cleaned up old ones